package com.example.myfoodrecipe.data.remote

import com.example.myfoodrecipe.data.model.FoodRecipe
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import okhttp3.Dispatcher
import retrofit2.Response
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.create

class RemoteRepository {
        private val retrofit = Retrofit.Builder()
            .baseUrl("https://api.spoonacular.com")
            .addConverterFactory(GsonConverterFactory.create())
            .build()
        private val foodApi = retrofit.create(FoodApi::class.java)


    suspend fun fetchFoodRecipe(type: String): Response<FoodRecipe>{
        return foodApi.fetchFoodRecipe(type)
    }
}